package models

import (
	"gitee.com/cjf8134/bbs_serve/internal/pkg/utils/constutil"
	"time"
)

type User struct {
	ID           int       `gorm:"column:id;primary_key" form:"id" json:"id"`
	GroupID      int       `form:"group_id" json:"group_id"`
	Username     string    `form:"username" json:"username"`
	Nickname     string    `form:"nickname" json:"nickname"`
	Password     string    `form:"password" json:"password"`
	Salt         string    `form:"salt" json:"salt"`
	Email        string    `form:"email" json:"email"`
	Mobile       string    `form:"mobile" json:"mobile"`
	Avatar       string    `form:"avatar" json:"avatar"`
	Level        int       `form:"level" json:"level"`
	Gender       int    `form:"gender" json:"gender"`
	Bio          string    `form:"bio" json:"bio"`
	Score        int       `form:"score" json:"score"`
	LoginAt      time.Time `form:"login_at" json:"login_at"`
	LoginIp      string    `form:"login_ip" json:"login_ip"`
	CreatedIp    string    `form:"created_ip" json:"created_ip"`
	CreatedAt    time.Time `form:"created_at" json:"created_at"`
	DeletedAt    *time.Time `form:"deleted_at" json:"deleted_at"`
	Status       int       `form:"status" json:"status"`
	Verification int       `form:"verification" json:"verification"`
}

func (User) TableName() string {
	return constutil.TablePrefix + "user"
}
